<style >
    /*.stockRoomDialog  .el-dialog__body{padding-bottom:0;}*/
    .stockRoomDialog  .el-form-item{width:100%;display:block;}
    /* .stockRoomDialog  .el-form-item.storeRoomAddress {width:-moz-calc(100% - 100px);width:-webkit-calc(100% - 100px);width:calc(100% - 100px)}; */
    .stockRoomDialog  .el-form-item.storeRoomAddress .el-form-item__content{width:-moz-calc(100% - 100px);width:-webkit-calc(100% - 100px);width:calc(100% - 100px)}
    .stockRoomDialog  .el-form-item.storeRoomAddress .el-form-item__content .el-form-item{margin-bottom:10px;margin-right:12px;width:auto;display:inline-block;}
    .stockRoomDialog  .el-form-item.storeRoomAddress .el-form-item .el-select{width:100px;}

    
    .stockRoomDialog .el-form-item.detailsAddress .el-form-item__content{width:-moz-calc(100% - 200px);width:-webkit-calc(100% - 200px);width:calc(100% - 200px);}


</style>
<template>
    <!--库房设置-->
    <div class="stock-room-setting-page">
        <el-form :inline="true" :model="roomSettingForm" class="demo-form-inline" style="border-bottom:1px solid #ccc;">
            <el-form-item label="库房编码" class="selectMB10">
                <el-input size="mini" v-model="roomSettingForm.code" placeholder="请输入库房"></el-input>
            </el-form-item>
            <el-form-item label="库房名称" class="selectMB10">
                <el-input size="mini" v-model="roomSettingForm.name" placeholder="请输入库房名称"></el-input>
            </el-form-item>
            <el-form-item label="库房描述" class="selectMB10">
                <el-input size="mini" v-model="roomSettingForm.remark" placeholder="请输入库房描述"></el-input>
            </el-form-item>
             <el-form-item label="当前状态" class="selectMB10" style="margin-right: 10px;">
                <el-select size="mini" clearable v-model="roomSettingForm.status" placeholder="请选择">
                    <el-option v-for="(status,index) in statusLists" :key="index" :label="status.lable" :value="status.value"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item class="selectMB10">
                <el-button class="bolder outsideBtnBS selectAll" :disabled="selectDisabled" size="mini" type="danger" @click="queryStoreroom()">查询</el-button>
            </el-form-item>
        </el-form>
        <!--表格-->
        <label class="default-label">库房明细列表：</label>
        <!--新增按钮-->
        <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="createNew()">新增</el-button>
        <el-table :data="storeRoomDetailsData" border style="width: 100%;" v-loading.body="loading" element-loading-text="拼命加载中">
            <el-table-column type="index" header-align="center" align="center" label="序"  width="40"></el-table-column>
            <el-table-column label="操作" header-align="center" align="center" width="100">
                <template scope="scope">
                    <div class="operationItem bolder" v-if="scope.row.status" @click="handleStatus(scope.$index,scope.row)">禁用</div>
                    <div class="operationItem bolder" v-else @click="handleStatus(scope.$index,scope.row)">启用</div> 
                    <div class="operationItem disabled bolder" v-if="scope.row.status">修改</div>
                    <div class="operationItem bolder" v-else @click="handleUpdate(scope.$index,scope.row)">修改</div>
                </template>
            </el-table-column>
            <el-table-column prop="statusName" label="状态" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column prop="code" label="库房编码" header-align="center" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column prop="name" label="库房名称" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="remark" label="库房描述" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="code" label="库房标识" header-align="center" width="100" show-overflow-tooltip></el-table-column>
            <!-- 
            <el-table-column prop="name" label="上级库房" header-align="center" show-overflow-tooltip></el-table-column>
            -->
            <el-table-column prop="areaName" label="地区" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="nationName" label="国家" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="provinceName" label="省" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="cityName" label="市" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="countyName" label="县(区)" header-align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="detailAddress" label="详细地址" header-align="center" show-overflow-tooltip></el-table-column>
        </el-table>
        <!--分页-->
        <el-pagination v-if="isPaging" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageIndex"  :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :page-count="totalPage" :total="totalNumber"></el-pagination>
         <!--新建弹窗-->
        <el-dialog title="新增库房信息" :visible.sync="dialogForm1Visible" size="small" class="stockRoomDialog" :lock-scroll="false">
            <el-form :inline="true" :model="addStockRoomForm" class="demo-form-inline addStockRoomForm" style="border-bottom:1px solid #ccc;" ref="addStockRoomForm"> 
                <el-form-item label="库房编码 " prop="code"  :rules="[{ required: true, message: '库房编码不能为空'},{ max: 20, message: '最多不可超过20字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="addStockRoomForm.code" placeholder="请输入库房编码信息"></el-input>
                </el-form-item>
                <el-form-item label="库房名称 " prop="name"  :rules="[{ required: true, message: '库房名称不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="addStockRoomForm.name" placeholder="请输入库房名称"></el-input>
                </el-form-item>
                <el-form-item label="库房描述 " prop="remark"  :rules="[{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="addStockRoomForm.remark" placeholder="请输入库房描述信息"></el-input>
                </el-form-item>
                <!-- 引入组件 -->
                <el-form-item label="库房地址 " :label-width="labelWidth" class="storeRoomAddress">
                    <v-address :formInline="addStockRoomForm" :result="defaultResult"></v-address>
                </el-form-item>
                <el-form-item label="详细地址 " class="detailsAddress" prop="detailAddress"  :rules="[{ required: true, message: '详细地址不能为空'},{ max: 260, message: '最多不可超过260字符'}]" :label-width="labelWidth">
                    <el-input type="textarea" :rows="2" v-model.trim="addStockRoomForm.detailAddress" placeholder="请输入详细地址"></el-input>
                </el-form-item>
                <el-form-item label="库房状态 " :label-width="labelWidth">
                    <el-radio-group v-model="addStockRoomForm.status">
                        <el-radio :label="true">启用</el-radio>
                        <el-radio :label="false">禁用</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="库房标识 " prop="warehouseTagCode"  :rules="[{ required: true, message: '库房标识不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-select v-model="addStockRoomForm.warehouseTagCode">
                        <el-option v-for="(warehouseTag,index) in warehouseTagList" :key="index" :label="warehouseTag.remark" :value="warehouseTag.code"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="标识编码 " prop="warehouseTagCode"  :rules="[{ required: true, message: '标识编码不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="addStockRoomForm.warehouseTagCode" placeholder="请输入标识编码" disabled></el-input>
                </el-form-item>
                <!-- 
                <el-form-item label="上级库房 " prop="name"  :rules="[{ required: true, message: '上级库房不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-select v-model="addStockRoomForm.countyNo">
                        <el-option v-for="(county,index) in nationData" :key="index" :label="county.countyName" :value="county.countyNo"></el-option>
                    </el-select>
                </el-form-item>
                -->
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="handleAddSAE">确定并退出</el-button>
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="handleAddSure">确定</el-button>
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="cancelSpareSubclass">取消</el-button>
            </div>
        </el-dialog>
        <!--修改弹窗-->
        <el-dialog title="修改库房信息" :visible.sync="dialogForm2Visible" size="small" class="stockRoomDialog" :lock-scroll="false">
            <el-form :inline="true" :model="updateStockRoomForm" class="demo-form-inline updateStockRoomForm" style="border-bottom:1px solid #ccc;" ref="updateStockRoomForm">
                <el-form-item label="库房编码" :label-width="labelWidth">
                    <el-input  v-model.trim="updateStockRoomForm.code" disabled></el-input>
                </el-form-item>
                <el-form-item label="库房名称 " prop="name"  :rules="[{ required: true, message: '库房名称不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="updateStockRoomForm.name" :title="updateStockRoomForm.name"></el-input>
                </el-form-item>
                <el-form-item label="库房描述 " prop="remark"  :rules="[{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="updateStockRoomForm.remark" placeholder="请输入库房描述"></el-input>
                </el-form-item>
                <el-form-item label="库房地址 " :label-width="labelWidth" class="storeRoomAddress">
                    <!-- 引入组件 -->
                    <v-address :formInline="updateStockRoomForm" :result="defaultResult"></v-address>
                    
                    <!-- 地区 
                    <el-form-item label="地区"  prop="area"  :rules="[{ required: true, message: '必填项'}]" class="label-w0">
                        <el-select v-model="updateStockRoomForm.area" placeholder="请选择" @change="getNation">
                            <el-option v-for="(area,index) in areaData" :key="index" :label="area.label" :value="area.value"></el-option>
                        </el-select>
                    </el-form-item>-->
                    <!-- 国家 
                    <el-form-item label="国家"  prop="nation"  :rules="[{ required: true, message: '必填项'}]" class="label-w0">
                        <el-select v-model="updateStockRoomForm.nation" placeholder="请选择" @change="getProvince">
                            <el-option v-for="(nation,index) in nationData" :key="index" :label="nation.label" :value="nation.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <br>-->
                    <!-- 省 
                    <el-form-item label="省份" prop="province"  :rules="[{ required: true, message: '必填项'}]" class="label-w0">
                        <el-select v-model="updateStockRoomForm.province" placeholder="请选择" @change="getCity">
                            <el-option v-for="(province,index) in provinceData" :key="index" :label="province.label" :value="province.value"></el-option>
                        </el-select>
                    </el-form-item>-->
                    <!-- 市 
                    <el-form-item label="市" prop="city"  :rules="[{ required: true, message: '必填项'}]" class="label-w0">
                        <el-select v-model="updateStockRoomForm.city" placeholder="请选择" @change="getCounty">
                            <el-option v-for="(city,index) in cityData" :key="index" :label="city.label" :value="city.value"></el-option>
                        </el-select>
                    </el-form-item>-->
                    <!-- 县(区) 
                    <el-form-item label="县(区)" prop="county"  :rules="[{ required: true, message: '必填项'}]" class="label-w0">
                        <el-select v-model="updateStockRoomForm.county" placeholder="请选择">
                            <el-option v-for="(county,index) in countyData" :key="index" :label="county.label" :value="county.value"></el-option>
                        </el-select>
                    </el-form-item>-->
                </el-form-item> 


                <el-form-item label="详细地址 " class="detailsAddress" prop="detailAddress"  :rules="[{ required: true, message: '详细地址不能为空'},{ max: 260, message: '最多不可超过260字符'}]" :label-width="labelWidth">
                    <el-input type="textarea" :rows="2" v-model="updateStockRoomForm.detailAddress" placeholder="请输入详细地址"></el-input>
                </el-form-item>
                <el-form-item label="库房状态 " :label-width="labelWidth">
                    <el-radio-group v-model="updateStockRoomForm.status">
                        <el-radio :label="true" disabled>启用</el-radio>
                        <el-radio :label="false" disabled>禁用</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="库房标识 " prop="warehouseTagCode"  :rules="[{ required: true, message: '库房标识不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-select v-model="updateStockRoomForm.warehouseTagCode">
                        <el-option v-for="(warehouseTag,index) in warehouseTagList" :key="index" :label="warehouseTag.remark" :value="warehouseTag.code"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="标识编码 " prop="warehouseTagCode"  :rules="[{ required: true, message: '标识编码不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-input  v-model.trim="updateStockRoomForm.warehouseTagCode" placeholder="请输入标识编码" disabled></el-input>
                </el-form-item>
                <!-- 
                <el-form-item label="上级库房 " prop="name"  :rules="[{ required: true, message: '上级库房不能为空'},{ max: 200, message: '最多不可超过200字符'}]" :label-width="labelWidth">
                    <el-select v-model="updateStockRoomForm.countyNo">
                        <el-option v-for="(county,index) in nationData" :key="index" :label="county.countyName" :value="county.countyNo"></el-option>
                    </el-select>
                </el-form-item>
                -->
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="handleUpdateSAE">确定并退出</el-button>
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="handleUpdateSure">确定</el-button>
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="cancleUpdateSubclass">取消</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
    import Vue from 'vue'
    export default {
        data() {
            return {
                // 查询表单
                roomSettingForm:{
                    name:"",
                    code:"",
                    remark:"",
                    status:""
                },
                statusLists:[],   //当前状态下拉列表
                storeRoomDetailsData:[],   //库房明细列表
                labelWidth:"100px",
                addStockRoomForm:{
                    name:"",
                    code:"",
                    status:false,
                    remark:"",
                    //五级联动
                    area:"",
                    nation:"",
                    province:"",
                    city:"",
                    county:"",
                    detailAddress:"",
                    warehouseTagRemark:"",
                    warehouseTagCode:""
                },
                addSureFlag:false,   // 新增的弹窗确定（不退出）
                nationData:[],
                warehouseTagList:[],    //库房标识下拉列表
                updateStockRoomForm:{
                    name:"",
                    code:"",
                    status:false,
                    remark:"",
                    //五级联动
                    area:"",
                    nation:"",
                    province:"",
                    city:"",
                    county:"",
                    detailAddress:"",
                    warehouseTagRemark:"",
                    warehouseTagCode:""
                },

                
                // areaData:[],
                // nationData:[],
                // provinceData:[],
                // cityData:[],
                // countyData:[],
                defaultResult:{},


                updateSureFlag:false,   // 修改的弹窗确定（不退出）
                loading:false,
                disabled:false,


                //弹窗
                dialogForm1Visible:false,
                dialogForm2Visible:false,
                // 分页
                isPaging:false,
                pageIndex:1,    //当前页（必传）
                pageSize :10,   //每页多少条
                totalNumber: 20,
                totalPage:2,
                
                //查询禁用
                selectDisabled:false
            };
        },
        //进入页面立即运行此方法
        mounted: function () {
                var _this = this;
                _this.$store.commit('currentActive', 'StoreroomSetting');
                // //ajax前后查询按钮禁用
                // $(".selectAll").ajaxStart(function(){
                //     _this.selectDisabled=true;
                // });
                // $(".selectAll").ajaxStop(function(){
                //     _this.selectDisabled=false;
                // });


                

                _this.dropDownValue();// 当前状态下拉列表
                _this.queryStoreroom();    //表单查询
        },
        methods:{
            // 当前状态下来列表
            dropDownValue(){
                var _this=this;
                var tmp=["warehouse.warehouseStatus"];
                $.ajax({
                    type:'POST',
                    url:_this.iwm_service+'stock/getPullDownList',
                    cache:false,
                    data:JSON.stringify(tmp),
                    dataType:'JSON',
                    contentType:"application/json;charset=utf-8",
                    success:function(data){
                        if(data.success){
                            _this.statusLists=data.data;
                        }else{
                            _this.common.errorTip(data.errorMessage);
                        }
                    }
                })
            },
            //查询库房列表
            queryStoreroom(){
                var _this=this;
                _this.loading=true;
                var tmp={
                    name:_this.roomSettingForm.name,
                    code:_this.roomSettingForm.code,
                    remark:_this.roomSettingForm.remark,
                    status:_this.roomSettingForm.status,
                    pageIndex:_this.pageIndex,
                    pageSize:_this.pageSize
                };
                _this.selectDisabled=true;
                $.ajax({
                    type: 'POST',
                    url: _this.iwm_service+"store/queryPage",
                    cache: false,
                    data:JSON.stringify(tmp),
                    dataType:'JSON',
                    contentType: "application/json;charset=utf-8",
                    success: function (data) {
                        if (data.success) {
                            _this.loading=false;
                            _this.isPaging=true;
                            _this.totalPage=data.data.totalPage;
                            _this.totalNumber=data.data.totalNumber;
                            _this.storeRoomDetailsData=data.data.dataList;
                        }else{
                            _this.common.errorTip(data.errorMessage)
                        }
                        _this.selectDisabled=false;
                    }
                });
            },
            // 库房标识下拉列表
            warehouseTagDropDown(){
                var _this=this;
                $.ajax({
                    type:'GET',
                    url:_this.iwm_service+'warehouse/queryWarehouseTagList',
                    cache:false,
                    // data:JSON.stringify(tmp),
                    dataType:'JSON',
                    contentType:"application/json;charset=utf-8",
                    success:function(data){
                        if(data.success){
                            _this.warehouseTagList=data.data;
                        }else{
                            _this.common.errorTip(data.errorMessage);
                        }
                    }
                })
            },
            //新增库房信息
            createNew(){
                var _this=this;
                _this.warehouseTagDropDown();
                _this.dialogForm1Visible=true; 
                if(this.$refs['addStockRoomForm']) {
                    this.$refs['addStockRoomForm'].resetFields();
                }
                _this.addStockRoomForm.name="";
                _this.addStockRoomForm.code="";
                _this.addStockRoomForm.remark="";
                _this.addStockRoomForm.status=false;
//                _this.addStockRoomForm.area="";
//                _this.addStockRoomForm.nation="";
//                _this.addStockRoomForm.province="";
//                _this.addStockRoomForm.city="";
//                _this.addStockRoomForm.county="";
                _this.addStockRoomForm.detailAddress="";
                _this.addStockRoomForm.warehouseTagCode="";
            },
            // 新增的确定并退出按钮
            handleAddSAE(){
                var _this = this;
                _this.addSureFlag = true;
                _this.handleAddSaveStoreRoom();
            },
            // 新增的确定按钮
            handleAddSure(){
                var _this = this;
                _this.addSureFlag = false;
                _this.handleAddSaveStoreRoom(1);
            },
            //新建保存
            handleAddSaveStoreRoom(parm){
                var _this=this;
                _this.$refs["addStockRoomForm"].validate((valid) => {
                    if (valid) {
                        var tmp={
                            name:_this.addStockRoomForm.name,   
                            code:_this.addStockRoomForm.code,
                            remark:_this.addStockRoomForm.remark,
                            status:_this.addStockRoomForm.status,
                            area:_this.addStockRoomForm.area,
                            nation:_this.addStockRoomForm.nation,
                            province:_this.addStockRoomForm.province,
                            city:_this.addStockRoomForm.city,
                            county:_this.addStockRoomForm.county,
                            detailAddress:_this.addStockRoomForm.detailAddress,
                            stockId:_this.addStockRoomForm.stockId
                        };
                        $.ajax({
                            type: 'POST',
                            url: _this.iwm_service+"store/add",
                            cache: false,
                            data:JSON.stringify(tmp),
                            dataType:'JSON',
                            contentType: "application/json;charset=utf-8",
                            success: function (data) {
                                if (data.success) {
                                    _this.common.successTip("保存成功！");
                                    if(_this.addSureFlag){
                                        _this.dialogForm1Visible=false;
                                    }
                                    //  确定成功后，才会清空原来填写的数据
                                    if(parm == 1){   
                                        if(_this.$refs['addStockRoomForm']) {
                                            _this.$refs['addStockRoomForm'].resetFields();
                                        }
                                        _this.addStockRoomForm.name=null;
                                        _this.addStockRoomForm.code=null;
                                        _this.addStockRoomForm.remark=null;
                                        _this.addStockRoomForm.status=false;
                                        _this.addStockRoomForm.area=null;
                                        _this.addStockRoomForm.nation=null;
                                        _this.addStockRoomForm.province=null;
                                        _this.addStockRoomForm.city=null;
                                        _this.addStockRoomForm.county=null;
                                        _this.addStockRoomForm.detailAddress=null;
                                        _this.addStockRoomForm.warehouseTagCode=null;
                                    }
                                    _this.queryStoreroom();
                                }else{
                                    _this.common.errorTip(data.errorMessage);
                                }
                            }
                        });
                    } else {
                        _this.common.errorTip("存在未填写的必填项！");
                        return false;
                    }
                });
            },
            //新建取消
            cancelSpareSubclass(){
                var _this=this;
                _this.dialogForm1Visible=false;
                if(this.$refs['addStockRoomForm']) {
                    this.$refs['addStockRoomForm'].resetFields();
                }
                _this.addStockRoomForm.name="";
                _this.addStockRoomForm.code="";
                _this.addStockRoomForm.remark="";
                _this.addStockRoomForm.status=false;
                _this.addStockRoomForm.area="";
                _this.addStockRoomForm.nation="";
                _this.addStockRoomForm.province="";
                _this.addStockRoomForm.city="";
                _this.addStockRoomForm.county="";
                _this.addStockRoomForm.detailAddress="";
                _this.addStockRoomForm.warehouseTagCode="";
            },
            // 操作启用禁用
            handleStatus(index, row){
                var _this=this;
                if(row.status){
                    row.status = false;
                }else{
                    row.status = true;
                }
                var tmp={id: row.id,status: row.status}; 
                $.ajax({
                    type: 'POST',
                    url: _this.iwm_service+"store/updateStatus",
                    cache: false,
                    data:JSON.stringify(tmp),
                    dataType:'JSON',
                    contentType: "application/json;charset=utf-8",
                    success: function (data) {
                        if (data.success) {
                            // 当前状态的显示
                            if(row.status){
                                row.statusName = "启用";
                                _this.common.successTip("启用成功！");
                            }else{
                                row.statusName = "禁用";
                                _this.common.successTip("禁用成功！");
                            }
                        }else
                            _this.common.errorTip(data.errorMessage);
                    }
                });
            },
            //点击修改
            handleUpdate(index,row){
                var _this=this;  
                _this.warehouseTagDropDown();
                _this.dialogForm2Visible=true;
                _this.updateStockRoomForm = Vue.util.extend(_this.updateStockRoomForm, row);
                // _this.updateStockRoomForm.id = row.id; 
                // _this.updateStockRoomForm.name = row.name;
                // _this.updateStockRoomForm.code = row.code;
                // _this.updateStockRoomForm.remark = row.remark;
                // _this.updateStockRoomForm.status = row.status;
                // _this.updateStockRoomForm.area =  row.area;
                // _this.updateStockRoomForm.nation = row.nation;
                // _this.updateStockRoomForm.province = row.province;
                // _this.updateStockRoomForm.city = row.city;
                // _this.updateStockRoomForm.county = row.county;
                // _this.updateStockRoomForm.detailAddress = row.detailAddress;
                // _this.updateStockRoomForm.warehouseTagRemark = row.warehouseTagRemark;
                // _this.updateStockRoomForm.warehouseTagCode = row.warehouseTagCode;
                this.defaultResult={
                    area:row.area,
                    nation:row.nation,
                    province:row.province,
                    city:row.city,
                    county:row.county
                }
            },
            // 修改的确定并退出按钮
            handleUpdateSAE(){
                var _this = this;
                _this.updateSureFlag = true;
                _this.handleSaveUpdateStoreRoom();
            },
            // 修改的确定按钮
            handleUpdateSure(){
                var _this = this;
                _this.updateSureFlag = false;
                _this.handleSaveUpdateStoreRoom();
            },
            //修改保存
            handleSaveUpdateStoreRoom(){
                var _this=this;
                _this.$refs["updateStockRoomForm"].validate((valid) => {
                    if (valid) {
                        var tmp={
                            id:_this.updateStockRoomForm.id,
                            name:_this.updateStockRoomForm.name,
                            code:_this.updateStockRoomForm.code,
                            remark:_this.updateStockRoomForm.remark,
                            status: _this.updateStockRoomForm.status,
                            area:_this.updateStockRoomForm.area,
                            nation:_this.updateStockRoomForm.nation,
                            province:_this.updateStockRoomForm.province,
                            city:_this.updateStockRoomForm.city,
                            county:_this.updateStockRoomForm.county,
                            detailAddress:_this.updateStockRoomForm.detailAddress,
                            warehouseTagCode:_this.updateStockRoomForm.warehouseTagCode,
                            };
                        $.ajax({
                            type: 'POST',
                            url: _this.iwm_service+"store/update",
                            cache: false,
                            data:JSON.stringify(tmp),
                            dataType:'JSON',
                            contentType: "application/json;charset=utf-8",
                            success: function (data) {
                                if (data.success) {
                                    _this.common.successTip("修改成功！");
                                    if(_this.updateSureFlag){
                                        _this.dialogForm2Visible=false;
                                    }
                                    _this.queryStoreroom();
                                }else
                                    _this.common.errorTip(data.errorMessage);
                            }
                        });
                    } else {
                        _this.common.errorTip("存在未填写的必填项！");
                        return false;
                    }
                });
            },
            //修改取消
            cancleUpdateSubclass(){
                var _this=this;
                _this.dialogForm2Visible=false;
            },
            //   分页
            handleSizeChange(val) {
                var _this=this;
                _this.pageSize=val;
                _this.queryStoreroom();

            },
            //点击页码分页查询点击事件
            handleCurrentChange(val) {
                var _this=this;
                _this.pageIndex=val;
                _this.queryStoreroom();
            }
        }
    }
</script>
